Time to add a score to our game! We'll use this to update the score every time the player catches food.

  • Go to and drag Integer Variable to the top of the program.
  • Change its value to 0 and its name to score.
  • From drag out Variable Display.
  • Change the name of the display to score_board and change the variable in .Display() to score.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)